import java.io.*;

public class Main {
    public static void main(String[] args) {
        File f= new File("score");
        Reader r = null;
        try {
            r = new FileReader(f);
        }catch (FileNotFoundException e){
            e.printStackTrace();
        }
        if (r!=null){
            BufferedReader bf = new BufferedReader(r);//缓冲流
            try {
                String line = bf.readLine();
                int totalS = 0;
                while ((line = bf.readLine()) != null) {
                    String[] strs = line.split("#");
                    int location = 0;
                    totalS = 0;
                    for (String item : strs) {
                        if (location == 0) {
                            location++;
                            continue;
                        } else {
                            int s = Integer.parseInt(item);
                            totalS += s;
                        }
                    }
                }
                System.out.println(totalS);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
    }
}